<?
if (!isset($r)) $r = "../";

require_once("w3m_connector.php");
error_reporting(E_ALL);
//$api = new API_action("login");	
//$api->UserCheckLogin("og@cid.kiev.ua","11111");

require_once($r."_engine/header_nocache.php");
require_once($r."_engine/c_feed.php");
require_once($r."_engine/c_sql_table.php");
require_once($r."_engine/c_monitor.php");
require_once($r."_engine/c_account.php");
require_once($r."_engine/c_sp_gate.php");




// Load feed from DB

/*
for ($counter = 0; true; $counter++) 
{
	$feeds = execute_query($q = 
		"SELECT * FROM feeds ".
		"WHERE monitor_id='".$mid."' AND type='".(((int)$type << 16)| CONTENT_TYPE_XML)."' ".
		"LIMIT 1"
	);

	if (@mysql_num_rows($feeds) > 0)
	{
		$feed = @mysql_fetch_array($feeds);
		@mysql_free_result($feeds);
	
		print_feed($feed["feed"]);
		die();
	}
	
	
	if ($counter > 0) {
		@header("HTTP/1.0 500 Internal Server Error");
		die();
	}
	
	
	// Feed not found in DB => call service to create the last one 
	global $g_spg;
	$res = $g_spg->RequestFeed($mid, $type);
}

*/


//echo get_link_to_feed($mon_item);





echo "<hr>";
?>